\(\int \sqrt {a+b x+c x^2} \, dx\) [2336]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 75 \[ \int \sqrt {a+b x+c x^2} \, dx=\frac {(b+2 c x) \sqrt {a+b x+c x^2}}{4 c}-\frac {\left (b^2-4 a c\right ) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{3/2}} \]

[Out]

-1/8*(-4*a*c+b^2)*arctanh(1/2*(2*c*x+b)/c^(1/2)/(c*x^2+b*x+a)^(1/2))/c^(3/2)+1/4*(2*c*x+b)*(c*x^2+b*x+a)^(1/2)
/c

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {626, 635, 212} \[ \int \sqrt {a+b x+c x^2} \, dx=\frac {(b+2 c x) \sqrt {a+b x+c x^2}}{4 c}-\frac {\left (b^2-4 a c\right ) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{3/2}} \]

[In]

Int[Sqrt[a + b*x + c*x^2],x]

[Out]

((b + 2*c*x)*Sqrt[a + b*x + c*x^2])/(4*c) - ((b^2 - 4*a*c)*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2
])])/(8*c^(3/2))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 626

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(b + 2*c*x)*((a + b*x + c*x^2)^p/(2*c*(2*p + 1
))), x] - Dist[p*((b^2 - 4*a*c)/(2*c*(2*p + 1))), Int[(a + b*x + c*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c}, x]
 && NeQ[b^2 - 4*a*c, 0] && GtQ[p, 0] && IntegerQ[4*p]

Rule 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(b+2 c x) \sqrt {a+b x+c x^2}}{4 c}-\frac {\left (b^2-4 a c\right ) \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{8 c} \\ & = \frac {(b+2 c x) \sqrt {a+b x+c x^2}}{4 c}-\frac {\left (b^2-4 a c\right ) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{4 c} \\ & = \frac {(b+2 c x) \sqrt {a+b x+c x^2}}{4 c}-\frac {\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{3/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.28 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00 \[ \int \sqrt {a+b x+c x^2} \, dx=\frac {\sqrt {c} (b+2 c x) \sqrt {a+x (b+c x)}+\left (b^2-4 a c\right ) \text {arctanh}\left (\frac {\sqrt {c} x}{\sqrt {a}-\sqrt {a+x (b+c x)}}\right )}{4 c^{3/2}} \]

[In]

Integrate[Sqrt[a + b*x + c*x^2],x]

[Out]

(Sqrt[c]*(b + 2*c*x)*Sqrt[a + x*(b + c*x)] + (b^2 - 4*a*c)*ArcTanh[(Sqrt[c]*x)/(Sqrt[a] - Sqrt[a + x*(b + c*x)
])])/(4*c^(3/2))

Maple [A] (verified)

Time = 0.33 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.87

method result size
default \(\frac {\left (2 c x +b \right ) \sqrt {c \,x^{2}+b x +a}}{4 c}+\frac {\left (4 a c -b^{2}\right ) \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{8 c^{\frac {3}{2}}}\) \(65\)
risch \(\frac {\left (2 c x +b \right ) \sqrt {c \,x^{2}+b x +a}}{4 c}+\frac {\left (4 a c -b^{2}\right ) \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{8 c^{\frac {3}{2}}}\) \(65\)

[In]

int((c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/4*(2*c*x+b)*(c*x^2+b*x+a)^(1/2)/c+1/8*(4*a*c-b^2)/c^(3/2)*ln((1/2*b+c*x)/c^(1/2)+(c*x^2+b*x+a)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 177, normalized size of antiderivative = 2.36 \[ \int \sqrt {a+b x+c x^2} \, dx=\left [-\frac {{\left (b^{2} - 4 \, a c\right )} \sqrt {c} \log \left (-8 \, c^{2} x^{2} - 8 \, b c x - b^{2} - 4 \, \sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {c} - 4 \, a c\right ) - 4 \, {\left (2 \, c^{2} x + b c\right )} \sqrt {c x^{2} + b x + a}}{16 \, c^{2}}, \frac {{\left (b^{2} - 4 \, a c\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, {\left (c^{2} x^{2} + b c x + a c\right )}}\right ) + 2 \, {\left (2 \, c^{2} x + b c\right )} \sqrt {c x^{2} + b x + a}}{8 \, c^{2}}\right ] \]

[In]

integrate((c*x^2+b*x+a)^(1/2),x, algorithm="fricas")

[Out]

[-1/16*((b^2 - 4*a*c)*sqrt(c)*log(-8*c^2*x^2 - 8*b*c*x - b^2 - 4*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(c) - 4
*a*c) - 4*(2*c^2*x + b*c)*sqrt(c*x^2 + b*x + a))/c^2, 1/8*((b^2 - 4*a*c)*sqrt(-c)*arctan(1/2*sqrt(c*x^2 + b*x
+ a)*(2*c*x + b)*sqrt(-c)/(c^2*x^2 + b*c*x + a*c)) + 2*(2*c^2*x + b*c)*sqrt(c*x^2 + b*x + a))/c^2]

Sympy [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.59 \[ \int \sqrt {a+b x+c x^2} \, dx=\begin {cases} \left (\frac {a}{2} - \frac {b^{2}}{8 c}\right ) \left (\begin {cases} \frac {\log {\left (b + 2 \sqrt {c} \sqrt {a + b x + c x^{2}} + 2 c x \right )}}{\sqrt {c}} & \text {for}\: a - \frac {b^{2}}{4 c} \neq 0 \\\frac {\left (\frac {b}{2 c} + x\right ) \log {\left (\frac {b}{2 c} + x \right )}}{\sqrt {c \left (\frac {b}{2 c} + x\right )^{2}}} & \text {otherwise} \end {cases}\right ) + \left (\frac {b}{4 c} + \frac {x}{2}\right ) \sqrt {a + b x + c x^{2}} & \text {for}\: c \neq 0 \\\frac {2 \left (a + b x\right )^{\frac {3}{2}}}{3 b} & \text {for}\: b \neq 0 \\\sqrt {a} x & \text {otherwise} \end {cases} \]

[In]

integrate((c*x**2+b*x+a)**(1/2),x)

[Out]

Piecewise(((a/2 - b**2/(8*c))*Piecewise((log(b + 2*sqrt(c)*sqrt(a + b*x + c*x**2) + 2*c*x)/sqrt(c), Ne(a - b**
2/(4*c), 0)), ((b/(2*c) + x)*log(b/(2*c) + x)/sqrt(c*(b/(2*c) + x)**2), True)) + (b/(4*c) + x/2)*sqrt(a + b*x
+ c*x**2), Ne(c, 0)), (2*(a + b*x)**(3/2)/(3*b), Ne(b, 0)), (sqrt(a)*x, True))

Maxima [F(-2)]

Exception generated. \[ \int \sqrt {a+b x+c x^2} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate((c*x^2+b*x+a)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more deta

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.88 \[ \int \sqrt {a+b x+c x^2} \, dx=\frac {1}{4} \, \sqrt {c x^{2} + b x + a} {\left (2 \, x + \frac {b}{c}\right )} + \frac {{\left (b^{2} - 4 \, a c\right )} \log \left ({\left | 2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} \sqrt {c} + b \right |}\right )}{8 \, c^{\frac {3}{2}}} \]

[In]

integrate((c*x^2+b*x+a)^(1/2),x, algorithm="giac")

[Out]

1/4*sqrt(c*x^2 + b*x + a)*(2*x + b/c) + 1/8*(b^2 - 4*a*c)*log(abs(2*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*sqrt(c
) + b))/c^(3/2)

Mupad [B] (verification not implemented)

Time = 10.06 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.84 \[ \int \sqrt {a+b x+c x^2} \, dx=\left (\frac {x}{2}+\frac {b}{4\,c}\right )\,\sqrt {c\,x^2+b\,x+a}+\frac {\ln \left (\frac {\frac {b}{2}+c\,x}{\sqrt {c}}+\sqrt {c\,x^2+b\,x+a}\right )\,\left (a\,c-\frac {b^2}{4}\right )}{2\,c^{3/2}} \]

[In]

int((a + b*x + c*x^2)^(1/2),x)

[Out]

(x/2 + b/(4*c))*(a + b*x + c*x^2)^(1/2) + (log((b/2 + c*x)/c^(1/2) + (a + b*x + c*x^2)^(1/2))*(a*c - b^2/4))/(
2*c^(3/2))